
     using SmartSoft.DAL;
 using System.Web.Services;
    using System;
    using System.Data;
    using System.Data.SqlClient;
    using System.Text;
using System.Configuration;

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class WSUserDataAccess : System.Web.Services.WebService
{
    private UserDataAccess objDataAccess = new UserDataAccess();
    public WSUserDataAccess()
    {
        SSDataAccess.ConnectionString = ConfigurationManager.ConnectionStrings["Connection"].ConnectionString;        
    }

    [WebMethod]
    public string Base64Decode(string ps_String)
    {
        return objDataAccess.Base64Decode(ps_String);
    }

    [WebMethod]
    public string Base64Encode(string ps_String)
    {

        return objDataAccess.Base64Encode(ps_String);
    }

    [WebMethod]
    public int ChangePassword(long pi_Stt, string ps_Password)
    {

        return objDataAccess.ChangePassword(pi_Stt, ps_Password);
    }

    [WebMethod]
    public DataSet GetDataSet()
    {
        return objDataAccess.GetDataSet();
    }

    [WebMethod]
    public DataTable GetTable(string ps_UserName)
    {

        return objDataAccess.GetTable(ps_UserName);
    }

    [WebMethod]
    public string GetUserName(string ps_UserName)
    {

        return objDataAccess.GetUserName(ps_UserName);
    }

    [WebMethod]
    public DataTable GetUserRights(string ps_FuncType, object pi_Usr_GrpID, string ps_Usr_Grp)
    {
        object[] arr = Validator.Validate(pi_Usr_GrpID);
        return objDataAccess.GetUserRights(ps_FuncType, arr[0], ps_Usr_Grp);
    }

    [WebMethod]
    public int GetUserType(string ps_UserName)
    {

        return objDataAccess.GetUserType(ps_UserName);
    }

    [WebMethod]
    public void ResetRights(string ps_UserOrGroup, object pi_UserOrder)
    {
        object[] arr = Validator.Validate(pi_UserOrder);
        objDataAccess.ResetRights(ps_UserOrGroup, arr[0]);
    }

    [WebMethod]
    public void SaveRights(string ps_UserOrGroup, object pi_UserOrder, string ps_FuncType, DataTable tableRow)
    {
        object[] arr = Validator.Validate(pi_UserOrder);
        objDataAccess.SaveRights(ps_UserOrGroup, arr[0], ps_FuncType, tableRow.Rows[0]);
    }

    [WebMethod]
    public int SaveRow(bool pb_NewChecked, DataTable tableRow)
    {

        return objDataAccess.SaveRow(pb_NewChecked, tableRow.Rows[0]);
    }

    [WebMethod]
    public bool UserValidated(string ps_UserName, string ps_Password)
    {

        return objDataAccess.UserValidated(ps_UserName, ps_Password);
    }
}